Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#05A778",
    list: [{
      pagePath: "/pages/home/index",
      iconPath: "/image/tabbar/home0.png",
      selectedIconPath: "/image/tabbar/home1.png",
      text: "首页"
    }, {
      pagePath: "/pages/cate/index",
      iconPath: "/image/tabbar/cate0.png",
      selectedIconPath: "/image/tabbar/cate1.png",
      text: "分类"
    }, {
      pagePath: "/pages/my/index",
      iconPath: "/image/tabbar/my0.png",
      selectedIconPath: "/image/tabbar/my1.png",
      text: "我的"
    }]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({
        url
      })
      this.setData({
        selected: data.index
      })
    },
  },

})